<!--
 * @作者: kerwin
 * @公众号: 大前端私房菜
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/css/home.css">
</head>
<body>
    home页面
    <div class="title">
        欢迎回来
    </div>
    <ul class="list">

    </ul>
    <script>

        fetch("/home/list").then(res=>res.json())
        .then(res=>{
            console.log(res)
            render(res)
        })

        function render(data){
            var list = data.map(item=>`<li>${item}</li>`)

            console.log(list.join(""))

            var oul = document.querySelector(".list")

            oul.innerHTML = list.join("")
        }
    </script>
</body>
</html>